package com.share.one.e_a_lifeCycle;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserDoImpl {
	
	private User user;
	
	

	public User getUser() {
		return user;
	}

	@Autowired
	public void setUser(User user) {
		System.out.println(user);
		System.out.println("UserDoImpl---set方法，属性的依赖注入");
		this.user = user;
	}

	static {
		System.out.println("UserDoImpl   静态代码块");

	}

	public UserDoImpl() {
		super();
		System.out.println("UserDoImpl   构造方法");
	}
	
	@PostConstruct
	public void initPost() {
		System.out.println("UserDoImpl   init-method:@PostConstruct");
	}
	
	@PreDestroy
	public void preDes() {
		System.out.println("UserDoImpl   destroy-method:@PreDestroy");
		
	}

	public void say(){
		System.out.println("目标方法");
	}
	
	public void say1(){
		System.out.println("目标方法1");
	}
}
